//
//  RW_UserModel.h
//  SleepApp
//
//  Created by MAC on 2021/3/25.
//  Copyright © 2021 RiceWang. All rights reserved.
//

#import "WLArchive.h"

NS_ASSUME_NONNULL_BEGIN

#define UserModel_WL (RW_UserModel *)[RW_UserModel readModel]

@interface RW_UserModel : WLArchive
/** 是否登陆 */
@property (nonatomic,assign) BOOL isLogin;
/** 用户D */
@property (nonatomic,copy) NSString *xid;
/** 用户昵称 */
@property (nonatomic,copy) NSString *nickName;
/** token */
@property (nonatomic,copy) NSString *token;



#pragma mark -- 网络请求
/**
 注册
 account:账号
 password:密码
 passwordConfirm:确认密码
 nickName:昵称
 code:验证码
 */
+ (FBLPromise<id> *)registrParamsMap:(NSDictionary *)paramsMap;

/**
 登陆
 account:账号
 password:密码
 code:验证码
 */
+ (FBLPromise<RW_UserModel *> *)loginParamsMap:(NSDictionary *)paramsMap;

/** 获取用户信息 */
+ (FBLPromise<RW_UserModel *> *)getUserInfo;
/** 刷新token */
+ (FBLPromise<NSString *> *)checkToken;

/** 退出登录 */
+ (FBLPromise<id> *)loginOut;
@end

NS_ASSUME_NONNULL_END
